package com.cdtye.itps.cms.mapper.dept;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cdtye.itps.cms.dao.dept.entity.SysDept;
import com.cdtye.itps.cms.dao.dept.vo.SysDeptVo;
import io.swagger.annotations.Api;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Api("部门 mapper")
@Repository
public interface SysDeptMapper extends BaseMapper<SysDept> {


    /**
     * 按条件获取单位
     * @param vo
     * @return
     */
    List<Map<String,Object>> getDeptList(@Param("vo") SysDeptVo vo);


    Map<String,Object> getDeptByFilter(@Param("vo") SysDeptVo vo);


    List<Map<String, Object>> getUnitDeptInfoList(@Param("vo") SysDeptVo vo);

    List<Map<String, Object>> getManageDeptList(@Param("map") Map<String, Object> map);

    List<String> getManageDeptIdList(@Param("map") Map<String, Object> map);

    Integer checkThisDeptIsBelongDeptChild(@Param("childDeptCode") String childDeptCode, @Param("parentDeptCode") String parentDeptCode);

    List<Map<String, Object>> getDeptAllChildAndMain(@Param("deptCode") String deptCode);

    List<Map<String, Object>> getDeptAllChildAndMainAndFilterFlag(@Param("deptCode") String deptCode, @Param("filterFlag") Integer filterFlag, @Param("filterTypeList") List<String> filterTypeList);

    List<Map<String, Object>> getDeptAllChildAndNotMain(@Param("deptCode") String deptCode);

    List<Map<String, Object>> getManageDeptAllChildAndMain(@Param("deptCode") String deptCode, @Param("deptCodeList") List<String> deptCodeList);

    List<Map<String, Object>> getManageDeptAllChildAndNotMain(@Param("deptCode") String deptCode, @Param("deptCodeList") List<String> deptCodeList);

    List<Map<String, Object>> getListByFid(@Param("fid") String fid, @Param("railType") String railType, @Param("status") String status);

    IPage<Map<String, Object>> pageList4Brain(IPage iPage, @Param("vo") SysDeptVo vo);
}
